package com.lyl.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class TestController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${spring.application.name}")
    private String appName;

    @Value("${server.port}")
    private String serverPort;

    //@Value("${eureka.client.service-url.defaultZone}")
    //private String eurekaUrl;

    @GetMapping("/getConfigInfo")
    public String getConfigInfo(){
        return configInfo;
    }

    //@RequestMapping("/config")
    //public String getConfig() {
    //    return "appName = " + appName
    //            + "，serverPort = " + serverPort
    //            + "，eurekaUrl = " + eurekaUrl;
    //}
}
